package com.student.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/**
 * AttendanceRecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Attendance_Record", schema = "dbo", catalog = "StudentManager")
public class AttendanceRecord implements java.io.Serializable {

	// Fields
	
	private Long attendanceRecordId;
	
	private AttendanceType attendanceType;
	
	private Integer count;
	
	private String starttime;
	
	private Student student;
	
	private Integer week;
	/** default constructor */
	public AttendanceRecord() {
	}
	/** minimal constructor */
	public AttendanceRecord(Long attendanceRecordId, Integer count) {
		this.attendanceRecordId = attendanceRecordId;
		this.count = count;
	}

	// Property accessors
	@Id
	@Column(name = "Attendance_Record_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getAttendanceRecordId() {
		return this.attendanceRecordId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "Attendance_Type_id")
	public AttendanceType getAttendanceType() {
		return this.attendanceType;
	}
	@Column(name = "Count", nullable = false)
	public Integer getCount() {
		return this.count;
	}

	// Constructors

	@Column(name = "starttime")
	public String getStarttime() {
		return starttime;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Student_id")
	public Student getStudent() {
		return this.student;
	}

	@Column(name = "week")
	public Integer getWeek() {
		return week;
	}

	public void setAttendanceRecordId(Long attendanceRecordId) {
		this.attendanceRecordId = attendanceRecordId;
	}

	public void setAttendanceType(AttendanceType attendanceType) {
		this.attendanceType = attendanceType;
	}


	public void setCount(Integer count) {
		this.count = count;
	}

	public void setStarttime(String starttime) {
		this.starttime = starttime;
	}


	public void setStudent(Student student) {
		this.student = student;
	}

	public void setWeek(Integer week) {
		this.week = week;
	}

}